% GET_STATISTICS
% INPUT
% p - predictions
% y - labels
% pl - positive label
%
% OUTPUT
% TP - logical array of true positives
% FP - logical array of false positives
% TN - logical array of true negatives
% FN - logical array of false negatives
function [TP, FP, TN, FN] = get_statistics(p, y, pl)

	% assume classes in {-1,1}
	p(p >= 0) = 1;
	p(p <  0) = -1;
    
    predPos = (p==pl);
    isPos = (y==pl);

	TP = (predPos & isPos);
	FP = (predPos & ~isPos);
	TN = (~predPos & ~isPos);
	FN = (~predPos & isPos);
	
end